//sizeof(d) = sizeof(b)+sizeof(c)-sizeof(a)+sizeof(dd)
#include <iostream>
using namespace std;

struct A {
  int aa;
  int aa2;
  virtual int get(){return aa;}
};

class B: public  A{
  int bb;
};

class C: public A{
  int cc;
};
class BC: public A{
  int bc;
};
class D: public B,public C, public BC{
public:
  int get(){return dd;}
  int dd;
  virtual void set(int d){ dd =d;}
};

class E:  virtual public D{
  int ee;
};
int main()
{
  A a;
  B b;
  C c;
  D d;
  E e;
  cout<<"sizeof(A)\t"<<sizeof(a)<<endl; //12 int aa,aa2; vptr
  cout<<"sizeof(B)\t"<<sizeof(b)<<endl; //20 int aa,aa2; vptr, bb,vptr
  cout<<"sizeof(C)\t"<<sizeof(c)<<endl; //20 int aa,aa2; vptr, cc,vptr
  cout<<"sizeof(D)\t"<<sizeof(d)<<endl;
                                   //32 int aa,aa2,a_vptr;bb, b_vptr;cc,c_vptr,dd
  cout<<"sizeof(E)\t"<<sizeof(e)<<endl;
  //36 int aa,aa2,a_vptr;bb,b_vptr;cc,c_vptr;dd;ee, ee_vptr;
}
